#include "../include/acceptor.h"
#include "../include/tcpConnection.h"
#include <iostream>
#include <unistd.h>

using std::cout;

int main()
{
	Acceptor acceptor("127.0.0.1",8888);
	
	acceptor.ready();

	TcpConnection con(acceptor.accept());

	cout << con.toString() << "has connect\n";

	while(1)
	{
		cout << ">>recv msg from client " << con.receive() << "\n";

		con.send("hello\n");

	}

	return 0;
}

